<template>
    <div style="padding:30px">
       <h3 style="
        font-weight: 700;
        font-style: normal;
        font-size: 24px;
        color: #344563;
        margin-bottom:20px
      ">
        系统设置
       </h3>
       <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="系统名称">
    <el-input v-model="form.sysName
" placeholder="维修调度系统" style="width:400px;"></el-input>
  </el-form-item>
  <el-form-item label="活动形式">
    <el-input type="textarea" v-model="form.sysAddress"  id="huoDong" placeholder="127.0.0.0"></el-input>
  </el-form-item>
  <el-form-item id="button">
    <el-button type="primary"  style="background:#6554C0;" @click="putData">立即创建</el-button>
  </el-form-item>
</el-form>
       
    </div>
</template>
<style scoped>
#button{
    margin: 220px auto;
   width:400px; 
   height:50px;
}
.el-button{
        color:black;
}
</style>
<style >
#huoDong{
    width:600px;
    height:130px;
}

</style>
<script>
  export default {
    data() {
      return {
        form: {
          sysAddress: '',
          sysName: '',
        }
      }
    },
    methods: {
    getData:function(){
      this.$axios({
        url:'/sys/list',
        methods:'get',
      }).then((res)=>{
        console.log(res);
        if(res.data.code==0){
           this.form.sysAddress=res.data.data[0].sysAddress;
           this.form.sysName=res.data.data[0].sysName;
        }else{
        }
      })
    },
    putData:function(){
      this.$axios({
        url:'/sys/update',
        method:'put',
        data: {
          id:1,
          sysAddress:this.form.sysAddress,
          sysName:this.form.sysName
        }
      }).then((res)=>{
        if(res.data.code==0){
         
        }else{
        }
      })
    }
    },
     mounted:function(){
    this.getData()
   
  }
  }
</script>